package com.seu.me.test.policy;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.xml.bind.annotation.*;
import java.util.List;

/**
 * @author liangfeihu
 * @since 2019/10/28 19:31
 */
@Data
@ToString
@NoArgsConstructor
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "TransInfo")
public class TransXmlInfo {
    private String TransType;
    private String TransTime;
    private String OutName;
    @XmlElement(name = "OUTTYPE")
    private String OutType;
    @XmlElement(name = "ACCEPTCOM")
    private String AcceptCom;

    @XmlElement(name = "PolicyInfoList")
    private PolicyData policyData;

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PolicyData {
        @XmlElements(value = {@XmlElement(name = "PolicyInfo", type = PolicyInfo.class)})
        List<PolicyInfo> policyInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PolicyInfo {
        private String PolicyNo;
        private String EdorValiDate;
        private String ValDate;
        private String EndData;
        private String ManageCom;
        private String ContState;
        private String CompanyNo;
        private String CompanyName;
        private String CompanyAddress;
        private String InsuredNum;
        private String Phone;
        private String Fax;
        private String EMail;
        private String BankCode;
        private String BankCodeName;
        private String BankAccNo;
        private String AccountName;
        private String PayMode;
        private String Premium;
        private String Remark;

        @XmlElement(name = "ContInfoList")
        private ContData contData;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class ContData {
        @XmlElements(value = {@XmlElement(name = "ContInfo", type = ContInfo.class)})
        List<ContInfo> contInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class ContInfo {
        private String InsuredNo;
        private String ContNo;
        private String EdorType;
        private String EdorValDate;
        private String InsuredName;
        private String Gender;
        private String IDType;
        private String IDNo;
        private String MasterRelation;
        private String MasterInsuredId;
        private String ValiDate;
        private String EndDate;
        private String ContState;
        private String BankCode;
        private String BankName;
        private String BankAccNo;
        private String AccName;
        private String IsRetired;
        private String Province;
        private String City;
        private String County;
        private String Address;
        private String ZipCode;
        private String Mobile;
        private String Phone;
        private String GrpSpec;

        @XmlElement(name = "BnfInfoList")
        private BnfInfoData bnfInfoData;
        @XmlElement(name = "PolInfoList")
        private PolInfoData polInfoData;

    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class BnfInfoData {
        @XmlElements(value = {@XmlElement(name = "BnfInfo", type = BnfInfo.class)})
        List<BnfInfo> bnfInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class BnfInfo {
        private String BnfAddress;
        private String BankAccount;
        private String BankProvince;
        private String BankCity;
        private String BankType;
        private String BankName;
        private String BankStreet;
        private String BIRTHDAY;
        private String EmailAccept;
        private String Gender;
        private String IDNo;
        private String IDType;
        private String IDValDate;
        private String IDEndDate;
        private String JOB;
        private String Phone;
        private String BnfName;
        private String BnfOrganization;
        private String PayType;
        private String Relation;
        private String Zip;
        private String BnfGrade;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PolInfoData {
        @XmlElements(value = {@XmlElement(name = "PolInfo", type = PolInfo.class)})
        List<PolInfo> polInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PolInfo {
        private String RiskCode;
        private String PolNo;
        private String PolValDate;
        private String PolEndDate;
        private String PolState;

        @XmlElement(name = "DutyInfoList")
        private DutyData dutyData;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DutyData {
        @XmlElements(value = {@XmlElement(name = "DutyInfo", type = DutyInfo.class)})
        List<DutyInfo> dutyInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DutyInfo {
        private String DutyCode;
        private String Amnt;
        private String WaitPeriod;
        private String DeductibleType;
        private String Deductibleds;
        private String SubLimit;
        private String YearLimit;

        @XmlElement(name = "GetDutyInfoList")
        private GetDutyData getDutyData;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class GetDutyData {
        @XmlElements(value = {@XmlElement(name = "GetDutyInfo", type = GetDutyInfo.class)})
        List<GetDutyInfo> getDutyInfoList;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class GetDutyInfo {
        private String Getdutycode;
        private String Standmoney;
        private String ActuGet;
        private String SumMoney;
        private String YearLimit;
    }

}
